package org.tony.spider.book;

import java.util.Date;

public class ChapterInfo
    implements Comparable<ChapterInfo>
{
  private Integer  sequence;
  private String   title;
  private String   url;
  private String   savePath;
  private Boolean  isVip;
  private Date     updateDate;
  private Book book;

  public String getTitle()
  {
    return title;
  }

  public void setTitle(String title)
  {
    this.title = title;
  }

  public String getUrl()
  {
    return url;
  }

  public void setUrl(String url)
  {
    this.url = url;
  }

  public String getSavePath()
  {
    return savePath;
  }

  public void setSavePath(String savePath)
  {
    this.savePath = savePath;
  }

  public Boolean getIsVip()
  {
    return isVip;
  }

  public void setIsVip(Boolean isVip)
  {
    this.isVip = isVip;
  }

  public Date getUpdateDate()
  {
    return updateDate;
  }

  public void setUpdateDate(Date updateDate)
  {
    this.updateDate = updateDate;
  }

  public Book getBook()
  {
    return book;
  }

  public void setBook(Book book)
  {
    this.book = book;
  }

  public Integer getSequence()
  {
    return sequence;
  }

  public void setSequence(Integer sequence)
  {
    this.sequence = sequence;
  }

  @Override
  public String toString()
  {
    return "ChapterInfo [title=" + title + ", url=" + url + "]";
  }

  public int compareTo(ChapterInfo o)
  {
    return this.sequence > o.sequence ? 1 : this.sequence == o.sequence ? 0 : -1;
  }
}
